import type { RouteRecordRaw } from 'vue-router'
import { DashboardOutlined } from '@ant-design/icons-vue'

// 延迟导入 Layout 组件
const Layout = () => import('@/layout/index.vue')

// 基础路由
export const baseRoutes: RouteRecordRaw[] = [
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [
      {
        path: '/dashboard',
        name: 'Dashboard',
        component: () => import('@/views/dashboard/index.vue'),
        meta: {
          title: 'menu.dashboard',
          icon: DashboardOutlined,
          affix: true
        }
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/index.vue'),
    meta: {
      title: 'menu.login',
      hidden: true
    }
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/error/404.vue'),
    meta: {
      title: 'menu.404',
      hidden: true
    }
  }
]

// 通配符路由，用于捕获所有未匹配的路由
export const catchAllRoute: RouteRecordRaw = {
  path: '/:pathMatch(.*)*',
  redirect: '/404',
  meta: {
    hidden: true
  }
} 